package com.example.ruihuada.ui.HomeModule.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.example.ruihuada.R


class GridListAdapter(data: List<Int>) :
    BaseQuickAdapter<Int, BaseViewHolder>(R.layout.list_item_grid, data) {
    override fun convert(helper: BaseViewHolder, item: Int?) {
        var position = helper.layoutPosition
        if (position < 3) {
            helper.setText(R.id.tv_top, "TOP${position + 1}")
        } else {
            helper.setVisible(R.id.tv_top, false)
        }
        helper.setBackgroundRes(R.id.im_item_bg, item!!)
    }


}